<?php
/**
 * 用户肤质管理 微信H5 页面接口
 *
 * Author: Zeon
 * Date: 2018/3/23
 * Created by Panxsoft.
 */

use Illuminate\Support\Facades\Route;


/** 微信端 */
Route::group(['middleware' => 'WechatAuth'], function () {

    /**
     * @see \App\Http\Controllers\Wechat\WechatUserController::show()
     */
    Route::get('/get-wechat-user', 'WechatUserController@show')
        ->name(\App\Http\Controllers\Wechat\WechatUserController::ROUTES['show']);

    /**
     * @see \App\Http\Controllers\Wechat\WechatUserController::index()
     */
    Route::get('/get-wechat-user-go-stores', 'WechatUserController@index')
        ->name(\App\Http\Controllers\Wechat\WechatUserController::ROUTES['index']);

    /**
     * @see \App\Http\Controllers\Wechat\WechatUserController::update()
     */
    Route::post('/update-wechat-user', 'WechatUserController@update')
        ->name(\App\Http\Controllers\Wechat\WechatUserController::ROUTES['update']);

    /**
     * @see \App\Http\Controllers\Wechat\WechatUserController::patchLocation()
     */
    Route::patch('/wechat-user-location', 'WechatUserController@patchLocation')
        ->name(\App\Http\Controllers\Wechat\WechatUserController::ROUTES['patch-location']);

    /**
     * @see \App\Http\Controllers\Wechat\WechatUserController::patchAliAccount()
     */
    Route::patch('/wechat-user-ali-account/{openid}', 'WechatUserController@patchAliAccount')
        ->name(\App\Http\Controllers\Wechat\WechatUserController::ROUTES['patch-ali-account']);

    /**
     * 肤质检测数据的展示
     *
     * @see \App\Http\Controllers\Wechat\SkinRecordController
     */
    Route::resource('/skin-record', 'SkinRecordController')
        ->names(\App\Http\Controllers\Wechat\SkinRecordController::ROUTE);

    /**
     * @deprecated - 微信端的推荐商品
     *
     * @see \App\Http\Controllers\Wechat\RecommendProductController
     */
    Route::resource('/recommend-product', 'RecommendProductController');

    /**
     * @deprecated - 微信端的推荐商品V2
     *
     * @see \App\Http\Controllers\Wechat\RecommendProductV2Controller
     */
    Route::resource('/recommend-product-v2', 'RecommendProductV2Controller')
        ->names(\App\Http\Controllers\Wechat\RecommendProductV2Controller::ROUTES);

    /**
     * @deprecated - 微信端的推荐商品V2 (有category_id分组)
     *
     * @see \App\Http\Controllers\Wechat\RecommendProductV2Controller::indexGroupByCategoryId()
     */
    Route::get('/index-group-by-category-id', 'RecommendProductV3Controller@index')
        ->name(\App\Http\Controllers\Wechat\RecommendProductV2Controller::ROUTES['index-group-by-category-id']);

    /**
     * 微信端的推荐商品V3 (有category_id分组)
     *
     * @see \App\Http\Controllers\Wechat\RecommendProductV3Controller::index()
     */
    Route::get('/recommend-product-v3', 'RecommendProductV3Controller@index')
        ->name(\App\Http\Controllers\Wechat\RecommendProductV3Controller::ROUTES['index']);

    /**
     * 微信端的红包管理
     *
     * @see \App\Http\Controllers\Wechat\Bonus\BonusController
     */
    Route::resource('/bonus', 'Bonus\BonusController')
        ->names(\App\Http\Controllers\Wechat\Bonus\BonusController::ROUTE);

});

/** 无公众号的用户h5页面的接口 */
Route::group(['middleware' => 'AppLocale'], function(){

    /**
     * 无公众号的用户登录接口
     *
     * @see \App\Http\Controllers\Wechat\WechatUserController::patchPhone()
     */
    Route::post('/patch-phone', 'WechatUserController@patchPhone')
        ->name(\App\Http\Controllers\Wechat\WechatUserController::ROUTES['patch-phone']);
});



